import java.util.HashMap;
import java.util.Objects;

public class TestDemo {

    public static void main(String[] args) {

        Person person1 = new Person("123");
        Person person2 = new Person("123");

        HashBuck2<Person,String> hash = new HashBuck2<>();
        hash.put(person1,"bit");
        hash.put(person2,"haha");
        System.out.println("================");
    }

    public static void main2(String[] args) {
        HashMap<Person,String> map = new HashMap<>();
        // ！！ 当放入自定义类型时，该类型必须重写 hashCode函数，否则映射就会出错
        map.put(new Person("123"),"123");
        map.put(new Person("123"),"123");
        System.out.println(map);
    }

    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(1,1);
        hashBuck.put(1,5);
        hashBuck.put(11,11);
        hashBuck.put(12,12);
        hashBuck.put(13,13);
        hashBuck.put(14,14);
        hashBuck.put(4,15);
        hashBuck.put(5,25);
        hashBuck.put(6,35);
        hashBuck.put(7,50);
        hashBuck.put(9,26);
        System.out.println(hashBuck.get(22));
    }
//    public int firstUniqChar(String s) {
//        int[] count = new int[26];
//        for (int i = 0; i < s.length(); i++) {
//            char c = s.charAt(i);
//            count[c-97]++;
//        }
//        for (int i = 0; i < s.length(); i++) {
//            char c = s.charAt(i);
//            if (count[(int)(c-97)] == 1){
//                return i;
//            }
//        }
//        return -1;
//    }
}